#include <unistd.h>
#include <stdlib.h>
#include <iostream>
using namespace std;


typedef unsigned int TypeUint;

TypeUint factorial(TypeUint num);


int main(int argc, char *argv[])
{
    TypeUint num, fact=1;
   
    if (argc>1)
    {
        num = atoi(argv[1]);
    } 
    else
    { 
        cout << "Error: Debe ingresar como argumento el numero a calcular el factorial!"<<endl;
        return -1;
    }
 
   fact = factorial(num);

        cout << "Factorial Comun de " << num << " es " << fact << endl;
// Auxiliary Functions:
}

TypeUint factorial(TypeUint num)
{
  TypeUint aux=(num>1? num: 1);
  if (aux>1)
  {
    aux *= factorial(aux-1);
  }
  return aux; 
}








